package com.edgarli.gamble.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.edgarli.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.edgarli.gamble.mapper.TLottoNzMapper;
import com.edgarli.gamble.domain.TLottoNz;
import com.edgarli.gamble.service.ITLottoNzService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 大乐透_内置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-08
 */
@Service
public class TLottoNzServiceImpl  extends ServiceImpl<TLottoNzMapper, TLottoNz> implements ITLottoNzService
{
    @Autowired
    private TLottoNzMapper tLottoNzMapper;

    /**
     * 查询大乐透_内置
     * 
     * @param lottoNzId 大乐透_内置主键
     * @return 大乐透_内置
     */
    @Override
    public TLottoNz selectTLottoNzByLottoNzId(Long lottoNzId)
    {
        return tLottoNzMapper.selectTLottoNzByLottoNzId(lottoNzId);
    }

    /**
     * 查询大乐透_内置列表
     * 
     * @param tLottoNz 大乐透_内置
     * @return 大乐透_内置
     */
    @Override
    public List<TLottoNz> selectTLottoNzList(TLottoNz tLottoNz)
    {
        return tLottoNzMapper.selectTLottoNzList(tLottoNz);
    }

    /**
     * 批量删除大乐透_内置
     * 
     * @param lottoNzIds 需要删除的大乐透_内置主键
     * @return 结果
     */
    @Override
    public int deleteTLottoNzByLottoNzIds(Long[] lottoNzIds)
    {
        return tLottoNzMapper.deleteTLottoNzByLottoNzIds(lottoNzIds);
    }

    /**
     * 删除大乐透_内置信息
     * 
     * @param lottoNzId 大乐透_内置主键
     * @return 结果
     */
    @Override
    public int deleteTLottoNzByLottoNzId(Long lottoNzId)
    {
        return tLottoNzMapper.deleteTLottoNzByLottoNzId(lottoNzId);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteAll() {
        tLottoNzMapper.delete(new LambdaQueryWrapper<>());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateNumAboutHidtory() {
        List<TLottoNz> tLottoNzs = tLottoNzMapper.selectNumByHistory();
        tLottoNzMapper.updateNumAboutHidtory(tLottoNzs);
    }
}
